﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="SUT.PrintEngine.Controls.ProgressDialog.ProgressDialogView"
    BorderThickness="0"
    Padding="0"
    Margin="0"
    MinWidth="500"   
    Height="Auto"
    Background="Transparent">
    <UserControl.Resources>
        <Style x:Key="{x:Type Thumb}" TargetType="{x:Type Thumb}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" CornerRadius="2" Background="Transparent">
                            <TextBlock Text="{TemplateBinding Tag}" Width="Auto" Foreground="Black" FontSize="13" FontFamily="Arial" FontWeight="Bold" Margin="5,0,0,0" TextAlignment="Left" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <StackPanel Orientation="Vertical" Width="Auto" Height="Auto">
        <Border Background="White" BorderThickness="1" BorderBrush="Gray" Margin="12" CornerRadius="12" x:Name="Container">
            <Border.BitmapEffect>
                <DropShadowBitmapEffect Color="Black" Direction="320"
                  ShadowDepth="2"
                  Softness="0.5"
                  Opacity="0.5"/>
            </Border.BitmapEffect>
            <DockPanel>
                <Border DockPanel.Dock="Top" Height="34" Margin="0,3,0,0" Padding="0,4,0,0" CornerRadius="0.12" HorizontalAlignment="Stretch">
                    <Grid>
                        <Grid.Background>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                <GradientStop Color="#FFFFFF" Offset="0.0" />
                                <GradientStop Color="#f0f0f0" Offset="1.0" />
                            </LinearGradientBrush>
                        </Grid.Background>
                        <Button Style="{DynamicResource CloseButtonStyle}"  Command="{Binding CancelCommand}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5,0,9,3" Background="#FFC8C8C8" Cursor="Hand"  Visibility="{Binding CancelButtonVisibility}" Width="25" Height="25" BorderBrush="#FF585858"/>
                        <TextBlock VerticalAlignment="Center" FontFamily="Arial" FontSize="13" Foreground="#313438" FontWeight="Bold" Margin="7,0" HorizontalAlignment="Left" Text="{Binding DialogTitle}"></TextBlock>
                    </Grid>
                </Border>
                <Border DockPanel.Dock="Top" Height="1" BorderThickness="1" BorderBrush="#CCCCCC" Margin="0,1,0,0" />
                <DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                    <Border Margin="10" Background="#f0f2f2" CornerRadius="7" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                        <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
                                <TextBlock FontFamily="Arial" FontSize="12" FontWeight="Bold" Margin="0,30,0,5"  Foreground="#272727" HorizontalAlignment="Center" Text="{Binding Message}" />                                
                            </StackPanel>
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                    <RowDefinition />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="10*" />
                                    <ColumnDefinition Width="80*" />
                                    <ColumnDefinition Width="10*" />
                                </Grid.ColumnDefinitions>
                                <TextBlock Grid.Row="0" Grid.Column="1" FontFamily="Arial" FontSize="12" FontWeight="Bold" Margin="0,30,0,5"  Foreground="#272727" HorizontalAlignment="Left" Text="{Binding ProgressText}" />
                                <Border Height="25" Grid.Row="1" Grid.Column="1" CornerRadius="10" BorderThickness="1" BorderBrush="#bac6c6">
                                    <ProgressBar x:Name="PBar" Maximum="{Binding MaxProgressValue}" Value="{Binding CurrentProgressValue}"  Background="White" Foreground="#7dc402"  Margin="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsIndeterminate="False"/>
                                </Border>
                                <Button x:Name="CancelButton" Cursor="Hand" Style="{DynamicResource DefaultButtonStyle}" Command="{Binding CancelCommand}" Content="{Binding CancelButtonCaption}" Margin="0,10,0,0" Grid.Row="2" Grid.Column="1" Width="80" Height="30" Visibility="{Binding CancelButtonVisibility}"/>
                            </Grid>                            
                            <Grid Margin="0,30,0,0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="10" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="10" />
                                </Grid.ColumnDefinitions>
                                <Border Height="Auto" Grid.Column="1" BorderThickness="1">
                                    <StackPanel Orientation="Vertical">
                                        <Border Background="#d2dadd" Height="0.5" />
                                        <Border Background="White" Height="0.5" />
                                    </StackPanel>
                                </Border>
                            </Grid>
                        </StackPanel>
                    </Border>
                </DockPanel>
            </DockPanel>
        </Border>
    </StackPanel>
</UserControl>
